﻿using AnimatingHair.Auxiliary;

namespace AnimatingHair.Entity.PhysicalEntity
{
    abstract class SPHParticle : PhysicalEntity
    {
        public double Density { get; set; }

        public VoxelGridCell ContainedIn { get; set; }

        public virtual void IntegrateForce( double timeStep )
        {
            Acceleration = Force / Mass;

            eulerIntegration( timeStep );
            //rungeKutta4Integration(timeStep);
        }

        private void eulerIntegration( double timeStep )
        {
            Velocity += timeStep * Acceleration;
            Position += timeStep * Velocity;
        }
    }
}